<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('完工签收单新增及修改')" />
	<th:block th:include="include :: businessCSS" />
	<style type="text/css">
		.layui-textarea{min-height:91px}
		.layui-form-switch{margin-top:0px}
	</style>
</head>
<body class="no-skin">
<div class="main-container" id="main-container">
	<div class="main-content">
	<form class="layui-form head-form">
	    <div class="north">
            <th:block th:include="include :: business_btn" />
	        <th:block th:include="include :: business_tpl('top')" />
			<!-- 资料移交	-->
			<div id="moveHtml">
				<div class="layui-inline margin_r0 layui-col-sm12">
					<label class="layui-form-label"><font class="f_red">*</font>资料移交：</label>
					<div class="layui-input-block">
						<div class="layui-inline margin_r0" style="width:13.3%;margin-left:20px">UPS说明书
							<input type="hidden" name="bUPSSms" value="false">
							<input type="checkbox" value="true" lay-skin="switch" lay-text="OK|NG" name="bUPSSms" id="bUPSSms" >
						</div>
						<div class="layui-inline margin_r0" style="width:13.3%;margin-left:20px">UPS合格证
							<input type="hidden" name="bUPSHgz" value="false">
							<input type="checkbox" value="true" lay-skin="switch" lay-text="OK|NG" name="bUPSHgz" id="bUPSHgz" >
						</div>
						<div class="layui-inline margin_r0" style="width:13.3%;margin-left:20px">UPS钥匙
							<input type="hidden" name="bUPSYs" value="false">
							<input type="checkbox" value="true" lay-skin="switch" lay-text="OK|NG" name="bUPSYs" id="bUPSYs" >
						</div>
						<div class="layui-inline margin_r0" style="width:13.3%;margin-left:20px">电池说明书
							<input type="hidden" name="bDcSms" value="false">
							<input type="checkbox" value="true" lay-skin="switch" lay-text="OK|NG" name="bDcSms" id="bDcSms" >
						</div>
						<div class="layui-inline margin_r0" style="width:13.3%;margin-left:20px">电池合格证
							<input type="hidden" name="bDcHgz" value="false">
							<input type="checkbox" value="true" lay-skin="switch" lay-text="OK|NG" name="bDcHgz" id="bDcHgz" >
						</div>
						<div class="layui-inline margin_r0" style="width:13.3%;margin-left:20px">电池柜钥匙
							<input type="hidden" name="bDcgYs" value="false">
							<input type="checkbox" value="true" lay-skin="switch" lay-text="OK|NG" name="bDcgYs" id="bDcgYs" >
						</div>
					</div>
				</div>
			</div>
    	</div>
	   	<th:block th:include="include :: pageFooter" /> 
        </form>
	</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: businessJS" />
<script type="text/html" id="toolbar">
	<div class="layui-btn-container">
        <div class="layui-btn layui-btn-normal layui-table-tools" lay-event="addBtn" shiro:hasPermission="business:completionreceipt:view">
			<i class="dhicon dh-plus"></i> 新增
        </div>
		<div class="layui-btn layui-btn-danger layui-table-tools" lay-event="deleteBatch" shiro:hasPermission="business:completionreceipt:delete">
    		<i class="dhicon dh-remove"></i> 删除
		</div>
		<div class="layui-btn layui-table-tools file" style="background:#5FB878" lay-event="importBtn" shiro:hasPermission="business:completionreceipt:import">
			<i class="dhicon dh-upload"></i> 导入
        </div>
    </div>
</script>
<th:block th:include="include :: inlineJS" />
<script type="text/javascript">
var $,layer,form,table,laydate,element;//定义layui模块
var nid = $("#nid").val(),noTable;//定义全局参数
layui.use(['laydate', 'form','layer','jquery','util','element'], function () {
 	$ = layui.$,layer = layui.layer,form = layui.form,table = layui.table,laydate = layui.laydate,util = layui.util,element=layui.element;
 	laydate.render({elem: '#dGzRqQs',type:'date',done:function(value, date, endDate){delta_T()}});
 	laydate.render({elem: '#dGzRqJs',type:'date',done:function(value, date, endDate){delta_T()}});
 	beforeInit();//表单初始化之前的动作集合
 	layui.element.render();
 	$.get("/business/completionreceipt/listbynid?nid="+nid,function(res){
 		noTable=res.data;
	});
 	//初始赋值
 	$.each(t_fields,function(v,k){
 		if(k.fieldContent)$('#'+k.fields).attr('checked','checked');
		if(gridColumns.readOnly)$('#'+k.fields).attr('disabled','disabled');
 	})
 	$('.layui-form-item .layui-col-sm4').last().after($('#moveHtml').html());
 	$('#moveHtml').remove();
 	form.render();
})
function delta_T(){//计算工作时间天数
	if($('#dGzRqQs').val() && $('#dGzRqJs').val()){
		var  startDate=Date.parse($('#dGzRqQs').val().replace('/-/g','/'));  
        var  endDate=Date.parse($('#dGzRqJs').val().replace('/-/g','/')); 
        var diffDate=(endDate-startDate)+1*24*60*60*1000;  
        var days=diffDate/(1*24*60*60*1000);  
        $('#fTs').val(days);
	}
}
</script>
</body>
</html>